<!DOCTYPE html><html><head><meta charset=utf-8><title>H3DU.MeshJSON</title></head><body><h1> H3DU.MeshJSON</h1><p><a href='index.html'>Back to documentation index.</a></p><a name='H3DU.MeshJSON'></a>
<h3> H3DU.MeshJSON()</h3>JSON exporter of graphics meshes.
<p>This class is considered a supplementary class to the
Public Domain HTML 3D Library and is not considered part of that
library. <p>
To use this class, you must include the script "extras/meshjson.js"; the
class is not included in the "h3du_min.js" file which makes up
the HTML 3D Library. Example:<pre>
&lt;script type="text/javascript" src="extras/meshjson.js">&lt;/script></pre><h3> Methods</h3><ul><li><a href='#H3DU.MeshJSON.loadJSON'>loadJSON</a><br>Loads a mesh from JSON format.<li><a href='#H3DU.MeshJSON.toJSON'>toJSON</a><br>Converts a mesh to JSON format.</ul><a name='H3DU.MeshJSON.loadJSON'></a>
<h3> (static) H3DU.MeshJSON.loadJSON(url)</h3>Loads a mesh from JSON format.<h4> Parameters</h4><ul><li><code>url</code> (Type: string)<br>URL to a JSON mesh object, as used in the Public Domain HTML 3D Library.</ul><h4> Return Value</h4>A promise that, when resolved, exposes an object
that implements a property named <code>toShape</code>, which is
a method that gets a <a href="H3DU.ShapeGroup.html">H3DU.ShapeGroup</a> describing the 3D mesh. (Type: <a href="Promise.html">Promise</a>)<a name='H3DU.MeshJSON.toJSON'></a>
<h3> (static) H3DU.MeshJSON.toJSON(mesh)</h3>Converts a mesh to JSON format.<h4> Parameters</h4><ul><li><code>mesh</code> (Type: <a href="H3DU.Mesh.html">H3DU.Mesh</a> | <a href="H3DU.MeshBuffer.html">H3DU.MeshBuffer</a>)<br>A mesh object or mesh buffer object, as used in the Public Domain HTML 3D Library.</ul><h4> Return Value</h4>A JSON string describing the mesh. (Type: string)<p><a href='index.html'>Back to documentation index.</a></p></body></html>
